var Person = function() {};
var p1 = new person();
p1 instanceof Person;

var Person = function() {};
var Programmer = function() {};
Programmer.prototype = new Person();
var p1 = new Programmer();

p1 instanceof Programmer;
p1 instanceof Person;

function instance_of(left, right) {
  let leftValue = left.__proto__;
  let rightValue = right.prototype;
  while (true) {
    // null 排除
    if (leftValue === null) {
      return false;
    }
    if (leftValue === rightValue) return true;
    leftValue = leftValue.__proto__; // 循环查找原型链
  }
}
